// team.js 的代码
'use strict';
module.exports = app => {
    const { STRING, INTEGER,DATE,DataTypes} = app.Sequelize; //获取 sequelize对应的数据类型映射
    // 1.3 https://itbilu.com/nodejs/npm/V1PExztfb.html   中有更详细的数据类型
    const Team = app.model.define('team', {
        h_memberid: {
          type: DataTypes.UUID,
          unique: true,
          allowNull: false,
          primaryKey: true,
          defaultValue: DataTypes.UUIDV4,
      },
      id: {
        type: INTEGER,
        primaryKey: true,       //主键
        autoIncrement: true,    //自增
        comment: "自增id"       //注释:只在代码中有效
      },
      sn:INTEGER,
      h_member_name:STRING,
      h_member_age:INTEGER,
      h_member_introduction:STRING,
      h_mumber_position:STRING,
      h_mumber_pic:STRING,
      imgUrl:STRING,
      create_time:DATE,
      update_time:DATE
    },{
      //freezeTableName默认值是 false 如果是false的话，会自动在表名后加s复数
      freezeTableName: true,
      //timestamps默认值是true，如实是true会自动添加上 create_time 和update_time两个字段
      timestamps: false ,
    });
    return Team;
}